package com.gzp.queue.listener;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;

/**
 * 监听器
 * 
 * @author Administrator
 *
 */
public class MyListener implements MessageListener {

	@Override
	public void onMessage(Message message) {
		if (message instanceof TextMessage) {
			TextMessage textMessage = (TextMessage) message;
			try {
				System.out.println("消息接收成功，消息内容为：" + textMessage.getText());
			} catch (JMSException e) {
				e.printStackTrace();
			}
		}

	}

}
